import Vue from 'vue'
import Order from './index.vue'

const OrderBox = Vue.extend(Order)
Order.install = function (data) {
  let instance = new OrderBox({
    data
  }).$mount()
  
  document.body.appendChild(instance.$el)

  Vue.nextTick(() => {
    instance.visible = true
  })
  return instance.showMsgBox().then(val => {
    return Promise.resolve(val);
  }).catch(err => {
    return Promise.reject(err);
  });
}

// export default Order
Vue.prototype.$Order = Order.install;